var t = getApp();

Page({
    data: {
        details: {},
        goodList: [],
        totalNum: 0,
        totalPrice: 0
    },
    onLoad: function(o) {
        o.id && 0 != o.id ? this.getDetails() : t.tips("参数错误");
    },
    getDetails: function(o) {
        var a = this, n = t.getNetAddresss("plugin.parent-payment.frontend.modules.payment.controllers.detail.index");
        t._postNetWork({
            url: n,
            data: {
                record_id: o
            },
            success: function(o) {
                var n = o.data;
                if (1 != n.result) return t.tips(n.msg);
                var e = n.data.order_goods, i = 0;
                e.forEach(function(t) {
                    i += t.total;
                }), a.setData({
                    details: n.data,
                    totalPrice: n.data.price,
                    goodList: e,
                    totalNum: i
                }), wx.setNavigationBarTitle({
                    title: n.data.plugin_name || "上级代付"
                });
            }
        });
    },
    onReady: function() {},
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareAppMessage: function() {}
});